<?php
class Ctrl extends AbstractCtrl
{
	public function test1(){
		echo "test de brute force<br />";

		AntiBruteForce::debloquer('gaetan');

		for($i=1; $i<=1010; $i++){
			echo $i.' => '.Base::getSession()->connexion('gaetan', $i).'<br />';
		}

		$nb = Base::getSql()->getNbQueries();
		$t = Base::getSql()->getTimeTotal();
		echo '<hr />'.$nb.' ('.$t.'s) => '.(($t/$nb)*1000).'ms';

	}

	public function test2(){
		$ret = Base::getSql()->query('SELECT*
			FROM t_users u
			INNER JOIN t_groups USING(pk_group)');

		import('libs.bdd.entity.UserEntity');
		$d = new UserEntity();

		while($d = $ret->fetchObject('UserEntity')){
			echo $d->insert().'<hr />';
			echo $d->update().'<hr />';
			echo $d->delete().'<hr />';
			echo $d->delete(array('name'=>'gaetan')).'<hr />';
		}
	}
}
?>